/** @file
  The Differentiated System Description Table.

  Copyright (C) 2022, Phytium Technology Co., Ltd. All rights reserved.<BR>

  SPDX-License-Identifier: BSD-2-Clause-Patent

**/

#include <AcpiPlatform.h>

DefinitionBlock("DsdtTable.aml", "DSDT", 2, "PHYLTD", "PHYTDSDT", EFI_ACPI_PHYTIUM_OEM_REVISION) {
  Scope(_SB)
  {
    Method (_OSC, 4, Serialized)  // _OSC: Operating System Capabilities
    {
      CreateDWordField (Arg3, Zero, STS0)
      CreateDWordField (Arg3, 0x04, CAP0)
      If ((Arg0 == ToUUID ("0811b06e-4a27-44f9-8d60-3cbbc22e7b48")))
      {
        //DBGC (0x02, "_OSC OSPM Arg1:", Arg1)
        //DBGC (0x02, "CAP0:", CAP0)
        //DBGC (0x02, "STS0:", STS0)
        If ((Arg1 != One))
        {
          STS0 &= 0xFFFFFFFFFFFFFFE0
          STS0 |= 0x0A
        }
        ElseIf ((CAP0 & 0x0100))
        {
          CAP0 &= 0xFFFFFFFFFFFFFEFF
          STS0 &= 0xFFFFFFFFFFFFFFE0
          STS0 |= 0x12
        }
      }
      Else
      {
        STS0 &= 0xFFFFFFFFFFFFFFE0
        STS0 |= 0x06
      }

      Return (Arg3)
    }
  }
  /*include ("Uart.asl")*/
  include ("Psd.asl")
  include ("Cpc.asl")
  include ("Die0Cpu.asl")
  include ("Die1Cpu.asl")
  include ("Die2Cpu.asl")
  include ("Die3Cpu.asl")
  include ("Die4Cpu.asl")
  include ("Die5Cpu.asl")
  include ("Die6Cpu.asl")
  include ("Die7Cpu.asl")
  include ("ThermalZone.asl")
  include ("Ceu.asl")
  include ("Pmu.asl")
}
